package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.CustomerProductOrder;
import com.rockcent.mall.lib.domain.enumclass.CustomerProductOrderStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

/**
 * Created by DK on 16/10/28.
 */
@Repository
public interface CustomerProductOrderRepository extends JpaRepository<CustomerProductOrder, Long>, JpaSpecificationExecutor, CustomerProductOrderRepositoryCustom {
    CustomerProductOrder findByMerchantOrderNumAndCustomerId(String mallOrderNum, Long customerId);

    CustomerProductOrder findByVerifyCodeAndStatusAndIsDelete(String verifyCode, CustomerProductOrderStatus status, Whether no);

    CustomerProductOrder findByVerifyKeyAndStatusAndIsDelete(String verifyKey, CustomerProductOrderStatus toUse, Whether no);

    CustomerProductOrder findByCustomerIdAndVerifyCodeAndStatusAndIsDelete(Long id, String verifyCode, CustomerProductOrderStatus used, Whether no);
}
